const express = require('express');
const { authenticateToken, requireTeacher } = require('../middleware/auth');
const TeacherCourseController = require('../controllers/teacher/CourseController');

const router = express.Router();

// 课程管理路由
router.get('/courses', authenticateToken, requireTeacher, TeacherCourseController.index);
router.post('/courses', authenticateToken, requireTeacher, TeacherCourseController.create);
router.get('/courses/:id', authenticateToken, requireTeacher, TeacherCourseController.show);
router.put('/courses/:id', authenticateToken, requireTeacher, TeacherCourseController.update);
router.delete('/courses/:id', authenticateToken, requireTeacher, TeacherCourseController.delete);
router.put('/courses/:id/publish', authenticateToken, requireTeacher, TeacherCourseController.publish);
router.put('/courses/:id/unpublish', authenticateToken, requireTeacher, TeacherCourseController.unpublish);
router.get('/courses/stats', authenticateToken, requireTeacher, TeacherCourseController.stats);

// 仪表板
router.get('/dashboard', authenticateToken, requireTeacher, (req, res) => {
  res.json({ code: 0, message: '教师仪表板', data: {} });
});

module.exports = router; 